package com.liang.cloud.Repository;


import com.liang.cloud.Entity.OrderMaster;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * @author: 余亮亮
 * @description:
 * @create: 2019-12-28 17:25:55
 **/
public interface OrderMasterRepository extends JpaRepository<OrderMaster,String> {
    /**
     * 根据买家openid查询分页订单主表
     * @param buyerOpenid
     * @param pageable
     * @return
     */
    public Page<OrderMaster> findByBuyerOpenid(String buyerOpenid, Pageable pageable);

    /**
     * 根据订单ID查询订单主表
     * @param orderId
     * @return
     */
    public OrderMaster findByOrderId(String orderId);

    /**
     * 根据openid用创建时间倒叙查找订单
     * @param openid
     * @return
     */
    public List<OrderMaster> findByBuyerOpenidOrderByCreateTimeDesc(String openid);
}
